package cn.iocoder.yudao.module.erp.dal.mysql.purchasemanage;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.purchasemanage.vo.PurchaseManagePageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchasemanage.PurchaseManageDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 采购管理主 Mapper
 *
 * @author admin
 */
@Mapper
public interface PurchaseManageMapper extends BaseMapperX<PurchaseManageDO> {

    default PageResult<PurchaseManageDO> selectPage(PurchaseManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseManageDO>()
                .likeIfPresent(PurchaseManageDO::getPlanName, reqVO.getPlanName())
                .eqIfPresent(PurchaseManageDO::getPurchasePlanNo, reqVO.getPurchasePlanNo())
                .orderByDesc(PurchaseManageDO::getId));
    }

}